import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);
export const constantRoutes = [
    {
        path: '/',
        redirect: '/dashboard'
    },
    {
        path: '/',
        component: resolve => require(['../components/common/Home.vue'], resolve),
        meta: { title: '自述文件' },
        children:[
            {
                path: '/dashboard',
                component: resolve => require(['../components/views/Dashboard.vue'], resolve),
                meta: { title: '系统首页' }
            },
            // {
            //     path: '/icon',
            //     component: resolve => require(['../components/views/Icon.vue'], resolve),
            //     meta: { title: '自定义图标' }
            // },
            // {
            //     path: '/table',
            //     component: resolve => require(['../components/views/BaseTable.vue'], resolve),
            //     meta: { title: '基础表格' }
            // },
            // {
            //     path: '/tabs',
            //     component: resolve => require(['../components/views/Tabs.vue'], resolve),
            //     meta: { title: 'tab选项卡' }
            // },
            // {
            //     path: '/form',
            //     component: resolve => require(['../components/views/BaseForm.vue'], resolve),
            //     meta: { title: '基本表单' }
            // },
            // {
            //     path: '/tree1',
            //     component: resolve => require(['../components/views/tree1.vue'], resolve),
            //     meta: { title: '基本树' }
            // },
            // {
            //     path: '/tree2',
            //     component: resolve => require(['../components/views/tree2.vue'], resolve),
            //     meta: { title: '可选择树' }
            // },
            // {
            //     path: '/tree3',
            //     component: resolve => require(['../components/views/tree3.vue'], resolve),
            //     meta: { title: '可编辑树' }
            // },
            // {
            //     // 富文本编辑器组件
            //     path: '/tree4',
            //     component: resolve => require(['../components/views/tree4.vue'], resolve),
            //     meta: { title: '可查询树' }
            // },
            // {
            //     // 富文本编辑器组件
            //     path: '/tree5',
            //     component: resolve => require(['../components/views/tree5.vue'], resolve),
            //     meta: { title: '节点选择' }
            // },
            // {
            //     // 富文本编辑器组件
            //     path: '/editor',
            //     component: resolve => require(['../components/views/VueEditor.vue'], resolve),
            //     meta: { title: '富文本编辑器' }
            // },
            // {
            //     // markdown组件
            //     path: '/markdown',
            //     component: resolve => require(['../components/views/Markdown.vue'], resolve),
            //     meta: { title: 'markdown编辑器' }    
            // },
            // {
            //     // 图片上传组件
            //     path: '/upload',
            //     component: resolve => require(['../components/views/Upload.vue'], resolve),
            //     meta: { title: '文件上传' }   
            // },
            // {
            //     // vue-schart组件
            //     path: '/charts',
            //     component: resolve => require(['../components/views/BaseCharts.vue'], resolve),
            //     meta: { title: 'schart图表' }
            // },
            // {
            //     // 拖拽列表组件
            //     path: '/drag',
            //     component: resolve => require(['../components/views/DragList.vue'], resolve),
            //     meta: { title: '拖拽列表' }
            // },
            // {
            //     // 拖拽Dialog组件
            //     path: '/dialog',
            //     component: resolve => require(['../components/views/DragDialog.vue'], resolve),
            //     meta: { title: '拖拽弹框' }
            // },
            // {
            //     // 权限页面
            //     path: '/permission',
            //     component: resolve => require(['../components/views/Permission.vue'], resolve),
            //     meta: { title: '权限测试', permission: true }
            // },
            // {
            //     path: '/404',
            //     component: resolve => require(['../components/views/404.vue'], resolve),
            //     meta: { title: '404' }
            // },
            // {
            //     path: '/403',
            //     component: resolve => require(['../components/views/403.vue'], resolve),
            //     meta: { title: '403' }
            // },
            {
                path: '/admin',
                component: resolve => require(['../components/views/admin.vue'], resolve),
                meta: { title: '用户信息' }
            },
            {
                path: '/openUserFactory',
                component: resolve => require(['../components/views/admin.vue'], resolve),
                meta: { title: '用户信息' }
            },
            {
                path: '/createAccount',
                component: resolve => require(['../components/views/admin.vue'], resolve),
                meta: { title: '用户信息' }
            },
            {
                path: '/LibraryQuestions',
                component: resolve => require(['../components/views/admin.vue'], resolve),
                meta: { title: '用户信息' }
            },
            {
                path: '/architecture',
                component: resolve => require(['../components/views/admin.vue'], resolve),
                meta: { title: '用户信息' }
            },
            {
                path: '/project',
                component: resolve => require(['../components/views/admin.vue'], resolve),
                meta: { title: '用户信息' }
            },
            {
                path: '/knowladge',
                component: resolve => require(['../components/views/admin.vue'], resolve),
                meta: { title: '用户信息' }
            },
            {
                path: '/list',
                component: resolve => require(['../components/views/admin.vue'], resolve),
                meta: { title: '用户信息' }
            },
            {
                path: '/lessonRecord',
                component: resolve => require(['../components/views/admin.vue'], resolve),
                meta: { title: '用户信息' }
            },
            {
                path: '/recordStatistics',
                component: resolve => require(['../components/views/admin.vue'], resolve),
                meta: { title: '用户信息' }
            },
            {
                path: '/openNoExamineCourse',
                component: resolve => require(['../components/views/admin.vue'], resolve),
                meta: { title: '用户信息' }
            },
            {
                path: '/rolePower',
                component: resolve => require(['../components/views/admin.vue'], resolve),
                meta: { title: '用户信息' }
            },
            {
                path: '/edituser',
                component: resolve => require(['../components/views/admin.vue'], resolve),
                meta: { title: '用户信息' }
            },
            {
                path: '/function',
                component: resolve => require(['../components/views/admin.vue'], resolve),
                meta: { title: '用户信息' }
            },
            {
                path: '/functionManager',
                component: resolve => require(['../components/views/admin.vue'], resolve),
                meta: { title: '用户信息' }
            },
            {
                path: '/lunboImage',
                component: resolve => require(['../components/views/admin.vue'], resolve),
                meta: { title: '用户信息' }
            },
            {
                path: '/systemNotice',
                component: resolve => require(['../components/views/admin.vue'], resolve),
                meta: { title: '用户信息' }
            },
            // {
            //     path: '/usermanager',
            //     component: resolve => require(['../components/views/sysmanager/usermanager.vue'], resolve),
            //     meta: { title: '用户管理' }
            // }
        ]
    },
    {
        path: '/login',
        component: resolve => require(['../components/views/Login.vue'], resolve)
    },
    {
        path: '*',
        redirect: '/404'
    }
]
console.log(66666);
console.log(constantRoutes);
const createRouter = () => new Router({
    // mode: 'history', // require service support
    scrollBehavior: () => ({ y: 0 }),
    routes: constantRoutes
  })
  
  const router = createRouter();
  export default router
// export default new Router({
//     routes: [
//         {
//             path: '/',
//             redirect: '/dashboard'
//         },
//         {
//             path: '/',
//             component: resolve => require(['../components/common/Home.vue'], resolve),
//             meta: { title: '自述文件' },
//             children:[
//                 {
//                     path: '/dashboard',
//                     component: resolve => require(['../components/views/Dashboard.vue'], resolve),
//                     meta: { title: '系统首页' }
//                 },
//                 {
//                     path: '/icon',
//                     component: resolve => require(['../components/views/Icon.vue'], resolve),
//                     meta: { title: '自定义图标' }
//                 },
//                 {
//                     path: '/table',
//                     component: resolve => require(['../components/views/BaseTable.vue'], resolve),
//                     meta: { title: '基础表格' }
//                 },
//                 {
//                     path: '/tabs',
//                     component: resolve => require(['../components/views/Tabs.vue'], resolve),
//                     meta: { title: 'tab选项卡' }
//                 },
//                 {
//                     path: '/form',
//                     component: resolve => require(['../components/views/BaseForm.vue'], resolve),
//                     meta: { title: '基本表单' }
//                 },
//                 {
//                     path: '/tree1',
//                     component: resolve => require(['../components/views/tree1.vue'], resolve),
//                     meta: { title: '基本树' }
//                 },
//                 {
//                     path: '/tree2',
//                     component: resolve => require(['../components/views/tree2.vue'], resolve),
//                     meta: { title: '可选择树' }
//                 },
//                 {
//                     path: '/tree3',
//                     component: resolve => require(['../components/views/tree3.vue'], resolve),
//                     meta: { title: '可编辑树' }
//                 },
//                 {
//                     // 富文本编辑器组件
//                     path: '/tree4',
//                     component: resolve => require(['../components/views/tree4.vue'], resolve),
//                     meta: { title: '可查询树' }
//                 },
//                 {
//                     // 富文本编辑器组件
//                     path: '/tree5',
//                     component: resolve => require(['../components/views/tree5.vue'], resolve),
//                     meta: { title: '节点选择' }
//                 },
//                 {
//                     // 富文本编辑器组件
//                     path: '/editor',
//                     component: resolve => require(['../components/views/VueEditor.vue'], resolve),
//                     meta: { title: '富文本编辑器' }
//                 },
//                 {
//                     // markdown组件
//                     path: '/markdown',
//                     component: resolve => require(['../components/views/Markdown.vue'], resolve),
//                     meta: { title: 'markdown编辑器' }    
//                 },
//                 {
//                     // 图片上传组件
//                     path: '/upload',
//                     component: resolve => require(['../components/views/Upload.vue'], resolve),
//                     meta: { title: '文件上传' }   
//                 },
//                 {
//                     // vue-schart组件
//                     path: '/charts',
//                     component: resolve => require(['../components/views/BaseCharts.vue'], resolve),
//                     meta: { title: 'schart图表' }
//                 },
//                 {
//                     // 拖拽列表组件
//                     path: '/drag',
//                     component: resolve => require(['../components/views/DragList.vue'], resolve),
//                     meta: { title: '拖拽列表' }
//                 },
//                 {
//                     // 拖拽Dialog组件
//                     path: '/dialog',
//                     component: resolve => require(['../components/views/DragDialog.vue'], resolve),
//                     meta: { title: '拖拽弹框' }
//                 },
//                 {
//                     // 权限页面
//                     path: '/permission',
//                     component: resolve => require(['../components/views/Permission.vue'], resolve),
//                     meta: { title: '权限测试', permission: true }
//                 },
//                 {
//                     path: '/404',
//                     component: resolve => require(['../components/views/404.vue'], resolve),
//                     meta: { title: '404' }
//                 },
//                 {
//                     path: '/403',
//                     component: resolve => require(['../components/views/403.vue'], resolve),
//                     meta: { title: '403' }
//                 },
//                 {
//                     path: '/admin',
//                     component: resolve => require(['../components/views/admin.vue'], resolve),
//                     meta: { title: '用户信息' }
//                 },
//                 {
//                     path: '/usermanager',
//                     component: resolve => require(['../components/views/sysmanager/usermanager.vue'], resolve),
//                     meta: { title: '用户管理' }
//                 }
//             ]
//         },
//         {
//             path: '/login',
//             component: resolve => require(['../components/views/Login.vue'], resolve)
//         },
//         {
//             path: '*',
//             redirect: '/404'
//         }
//     ]
// })
